home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / dev / c / vbcc.lha / vbcc / doc / pasm.doc < prev    next >
Text File  |  2001-04-28  |  46KB  |  2,225 lines

  1. pasm V1.5          VBCC ANSI C Compiler Reference Manual            pasm V1.5
  2.  
  3. NAME
  4.      pasm - PowerPC assembler
  5.  
  6. SYNOPSIS
  7.      pasm [-mwxRVX] [-B address] [-D symbol[=value]] [-F format]
  8.           [-I include-path] [-O opt-level] [-o filename] source-file
  9.  
  10. DESCRIPTION
  11.      pasm is a 32/64-bit PowerPC assembler and its usual task is to
  12.      assemble the output of the vbcc C compiler. It supports macros
  13.      and include files, so it could also be used for direct PowerPC
  14.      program development.
  15.  
  16.      pasm uses the same syntax as Motorola's PAS assembler or the
  17.      PPC-port of the GNU assembler.
  18.  
  19.      All PowerPC standard instructions are supported: User level-,
  20.      supervisor level-, optional-, 32-bit and 64-bit instructions.
  21.      Additionally, there is a huge set of extended mnemonics as proposed
  22.      in the "PowerPC Programming Environments" from IBM and Motorola.
  23.  
  24.      The options are as follows:
  25.  
  26.      -B address
  27.              Sets the base address for absolute output format.
  28.  
  29.      -D symbol[=value]
  30.              Defines a symbol. Its value defaults to '1'.
  31.  
  32.      -F format
  33.              Sets the output file format:
  34.              0: Absolute, raw format. Base address defaults to
  35.                 zero, but may be changed by "-B addr".
  36.              1: ELF-32bit-PowerPC object.
  37.              2: EHF object. Only used under AmigaOS with WarpOS
  38.                 extension from Haage&Partner.
  39.              3: ADOS object. The difference between ADOS and and EHF
  40.                 is, that ADOS uses HUNK_CODE instead HUNK_PPC_CODE
  41.                 and doesn't support any PPC-specific relocations and
  42.                 reference types. This makes it possible to link
  43.                 simple PowerPC programs with an old linker, like
  44.                 BLink, SLink or PhxLnk.
  45.  
  46.      -I include-path
  47.              Adds another include file path. Example:
  48.              -IWork:PPCIncludes  or  -I /usr/local/include
  49.  
  50.      -m64    Enable 64-bit instructions.
  51.  
  52.      -ms     Enable supervisor instructions.
  53.  
  54.      -mo     Enable optional instructions.
  55.  
  56.      -O opt-level
  57.              Sets optimization level. The level contains 32 flags to
  58.              enable different optimizations and features. Currently,
  59.              the following are used:
  60.              65536: Automatic correction of far branches. A
  61.                     "Bcc label" with label out of range (more
  62.                     than 32764 bytes away) will be converted
  63.                     into a "B!cc $+8 / B label" combination.
  64.  
  65.      -o filename
  66.              Specifies the name of the output file. If not given, pasm
  67.              will use the name of the source text and replaces the
  68.              extension by ".o".
  69.  
  70.      -R      Don't predefine register symbols r0-r31, f0-f31, cr0-c7,
  71.              xer, eq, etc.
  72.  
  73.      -V      Prints version identification and build string. Example:
  74.              pasm V0.69 (Amiga OS/M68k)  (c)1997-98 by Frank Wille
  75.              build date: Jan  2 1998, 11:51:47
  76.  
  77.      -w      Suppress all warning messages.
  78.  
  79.      -x      Undefined symbols are automatically defined as external
  80.              symbols.
  81.  
  82.      -X      No extended mnemonics. This means you will have to write
  83.              "bc 12,2,label" instead "beq label". All predefined extened
  84.              mnemonics are listed in the section EXTENDED MNEMONICS.
  85.  
  86.      -a      Forces allocation of common symbols in .bss section.
  87.              Otherwise real common symbols will be created by ".comm"
  88.              directives.
  89.  
  90.  
  91. GENERAL FORMAT
  92.      Source texts in the following format will be accepted by pasm:
  93.  
  94.      [<label>] [<opcode> [<operand>[,<operand>,...]]]
  95.  
  96.      The opcode field may start at the first column, because pasm requires
  97.      all labels to be terminated by a ':'. Opcodes are directives, macros
  98.      and PowerPC instructions.
  99.  
  100.      These statements are separated by a line feed (0xa) or a ';' character.
  101.      Theoretically, you can write your whole program in a single line.
  102.      Example:
  103.  
  104.      .text;.global start;start: li r3,0;blr
  105.  
  106.      Comments are introduced by a '#':
  107.  
  108.      # This is a comment
  109.              nop     # another comment
  110.  
  111.  
  112. SNYTAX
  113.  
  114.      Supported operators in expressions:
  115.  
  116.           Unary (highest priority):
  117.           +             positive
  118.           -             negate
  119.           ~             not
  120.  
  121.           Binary (priority):
  122.           +             addition (4)
  123.           -             subtraction (4)
  124.           *             multiplication (5)
  125.           /             division (5)
  126.           %             modulo (5)
  127.           <<            shift left (3)
  128.           >>            shift right (3)
  129.           &             and (2)
  130.           |             or (0)
  131.           ^             exclusive or (1)
  132.  
  133.      Supported constants:
  134.  
  135.           1234          decimal
  136.           01234         octal
  137.           0x1234        hexadecimal
  138.           0b1010        binary
  139.           "abcd"        string
  140.  
  141.      ELF relocation suffix:
  142.  
  143.           Syntax: <expression>@<reloc type>
  144.  
  145.           @l            low half word (R_PPC_ADDR16_LO)
  146.           @h            high half word (R_PPC_ADDR16_HI)
  147.           @ha           high half word for addition (R_PPC_ADDR16_HA)
  148.           @sdax         base relative section offset (R_PPC_SDAREL16)
  149.           @sdarx        base relative section offset (R_PPC_SDAREL16)
  150.           @sdarel       base relative section offset (R_PPC_SDAREL16)
  151.           @sda2rel      base relative section offset (R_PPC_EMB_SDA2REL)
  152.           @sda21        base relative section offset (R_PPC_EMB_SDA21)
  153.           @sdai16       creates sym. addr. entry in .sdata (R_PPC_EMB_SDAI16)
  154.           @sda2i16      cr. sym. addr. entry in .sdata2 (R_PPC_EMB_SDA2I16)
  155.  
  156.  
  157.  
  158. DIRECTIVES
  159.       .2byte <exp1>[,<exp2>...]
  160.       ---------------------------
  161.       See ".uahalf".
  162.  
  163.       .4byte <exp1>[,<exp2>...]
  164.       --------------------------
  165.       See ".uaword".
  166.  
  167.       .ascii <exp1>[,<exp2>,"<string1>"...]
  168.       ----------------------------------
  169.       See ".byte".
  170.  
  171.       .asciiz "<string1>"[,"<string2>"...]
  172.       ------------------------------------
  173.       See ".string".
  174.  
  175.       .align <bit_count>
  176.       ------------------
  177.       Insert as much zero bytes as required to reach an address where
  178.       <bit_count> low order bits are zero. For example ".align 2" would
  179.       make an alignment to the next 32-bit boundary.
  180.  
  181.       .baserel <section>,<base_reg>
  182.       -----------------------------
  183.       Allow base relative access via register <base_reg> in the section
  184.       called <section>. In absolute mode, <base_reg> must be initialized
  185.       with an address pointing 32764 bytes behind the start address of
  186.       this section. In EHF, <base_reg> must be initialized with the linker
  187.       symbol _LinkerDB. By default, base relative access via r2 (rtoc)
  188.       on the section ".tocd" is set.
  189.       ** This directive is obsolete, since pasm V1.1! **
  190.       pasm can access multiple small data sections using the .sdreg
  191.       directive now. .baserel may be useful, when creating an
  192.       absolute output file, though.
  193.  
  194.       .bss <symbol>,<size>[,<alignment>]
  195.       ----------------------------------
  196.       Allocate <size> bytes of space in the .bss section and assign
  197.       the value to that location to <symbol>. If <alignment> is given,
  198.       then the space will be aligned to an address having <alignment>
  199.       low zero bits or 2, whichever is greater.
  200.       <symbol> may be made globally visible by the .globl directive.
  201.  
  202.       .byte <exp1>[,<exp2>,"<string1>"...]
  203.       ------------------------------------
  204.       Assign the integer or string constant operands into successive
  205.       bytes of memory in the current section. Any combination of integer
  206.       and character string constant operands is permitted.
  207.  
  208.       .comm <symbol>,<size>
  209.       ---------------------
  210.       Defines a common symbol which has a size of <size> bytes. The
  211.       final size and alignment will be assigned by the linker, which
  212.       will use the highes size and alignment values of all common
  213.       symbols with the same name found. A common symbol is allocated
  214.       in the .bss section in the final executable. ".comm"-areas of
  215.       less than 8 bytes in size are aligned to word boundaries, other-
  216.       wise to doubleword boundaries.
  217.  
  218.       .double <float1>[,<float2>...]
  219.       ------------------------------
  220.       If the current section location counter is not on a doubleword
  221.       boundary advance it to the next doubleword boundary. Then assign
  222.       the values of the operands as IEEE 754 double-precision 64-bit
  223.       format numbers to successive doublewords of memory in the current
  224.       section.
  225.  
  226.       .else
  227.       -----
  228.       Begins the "else"-part in a block of conditional assembly.
  229.  
  230.       .endif
  231.       ------
  232.       Ends a block of conditional assembly.
  233.  
  234.       .endm
  235.       -----
  236.       Ends a macro definition.
  237.  
  238.       .endr
  239.       -----
  240.       Ends a repetition block.
  241.  
  242.       .extern <symbol>
  243.       ----------------
  244.       See ".globl".
  245.  
  246.       .fail
  247.       -----
  248.       Abort assembly with displaying the error message "fail directive
  249.       encountered".
  250.  
  251.       .file "<file name>"
  252.       -------------------
  253.       Specify the source file name, which is included into the ELF object
  254.       file as a symbol of type "FILE" with local binding. In EHF objects,
  255.       it is used as unit name.
  256.  
  257.       .float <float1>[,<float2>...]
  258.       -----------------------------
  259.       If the current section location counter is not on a word boundary
  260.       advance it to the next word boundary. Then assign the values of the
  261.       operands as IEEE 754 single precision 32-bit format numbers to
  262.       successive words of memory in the current section.
  263.  
  264.       .global <symbol>
  265.       ----------------
  266.       See ".globl".
  267.  
  268.       .globl <symbol>
  269.       ---------------
  270.       Flag <symbol> as an external symbol, which means that <symbol> is
  271.       visible to all modules in the linking process. It may be either
  272.       defined or undefined.
  273.  
  274.       .half <exp1>[,<exp2>...]
  275.       ------------------------
  276.       If the current section location counter is not on a halfword
  277.       boundary, advance it to the next halfword boundary. Then, assign
  278.       the values of the operands into successive halfwords of memory in
  279.       the current section.
  280.  
  281.       .ident "<string>"
  282.       -----------------
  283.       Place an indentification string into the .comment section (ELF).
  284.  
  285.       .if<cond> <exp>
  286.       ---------------
  287.       The following block will only be assembled, if the condition <cond>
  288.       is valid for the expression <exp>. Available conditions are:
  289.       .if     assemble, if <exp> is not zero.
  290.       .ifeq   assemble, if <exp> is zero.
  291.       .ifne   assemble, if <exp> is not zero.
  292.       .ifgt   assemble, if <exp> is greater than zero.
  293.       .ifge   assemble, if <exp> is greater than zero or equal (positive).
  294.       .iflt   assemble, if <exp> is less than zero (negative).
  295.       .ifle   assemble, if <exp> is less than zero or equal.
  296.       .ifdef  assemble, if <exp> is defined.
  297.       .ifndef assemble, if <exp> is undefined.
  298.       A block of conditional assembly is ended by ".endif". A maximum of
  299.       eight if-levels is allowed.
  300.  
  301.       .incbin <file name>
  302.       -------------------
  303.       Inserts the contents of a binary file into the current section.
  304.  
  305.       .include <file name>
  306.       --------------------
  307.       Includes another source text. Besides the current directory, all
  308.       include paths defined by the -I option are searched.
  309.  
  310.       .lcomm <symbol>,<size>[,<alignment>]
  311.       ------------------------------------
  312.       See ".bss".
  313.  
  314.       .local <symbol>
  315.       ---------------
  316.       Explicitely declare symbol to have local binding. It is not
  317.       visible outside the object file containing its definition.
  318.       <symbol> must be known (ELF only).
  319.  
  320.       .long <exp1>[,<exp2>...]
  321.       ------------------------
  322.       See ".word".
  323.  
  324.       .macro <name>
  325.       -------------
  326.       Define a new macro, called <name>. Macro parameters can be acces-
  327.       sed by \1 to \9. \0 is reserved for the branch hint. Example:
  328.       .macro  bdz
  329.               bc\0   18,0,\1
  330.       .endm
  331.       \@ will be replaced by a unique number on every macro invocation
  332.       and should be used when defining labels in a macro.
  333.  
  334.       .newsection <name>[,"<attributes>"]
  335.       -----------------------------------
  336.       This directives differs from the normal .section directive in the
  337.       case if a section called <name> already exists. .newsection will
  338.       then force the start of a new section with the same name and
  339.       effectively ends any further definition for the earlier section.
  340.       For the rest, see ".section".
  341.  
  342.       .rept <count>
  343.       -------------
  344.       Defines a repetition. The code between .rept and .endr is
  345.       assembled <count> times.
  346.  
  347.       .sdreg <base_reg>
  348.       -----------------
  349.       Set a base register (r2-r31) for small data access. This enables
  350.       auto detection of base relative data access. The normal method
  351.       to create a R_PPC_SDAREL16 relocation would be:
  352.         lwz    r3,variable@sdarx(r13)   # r13: small data base reg.
  353.  
  354.       .section <name>[,"<attributes>"]
  355.       --------------------------------
  356.       Starts a new section named <name> or reactivate an old one. If
  357.       attributes are given for an already existing section, they must
  358.       match exactly. The section's name will also be defined as a new
  359.       symbol, which represents the section's start address.
  360.       The "<attributes>" string may consist of the following characters:
  361.       Section Contents:
  362.             c - section has code
  363.             d - section has initialized data
  364.             u - section has uninitialized data
  365.             i - section has directives (info section)
  366.             n - section can be discarded
  367.             R - remove section at link time
  368.             a - section is allocated in memory
  369.       Section Protection:
  370.             r - section is readable
  371.             w - section is writable
  372.             x - section is executable
  373.             s - section is sharable
  374.       Section Alignment (only one):
  375.             0 - align to byte boundary
  376.             1 - align to halfword boundary
  377.             2 - align to word boundary
  378.             3 - align to doubleword boundary
  379.             4 - align to quadword boundary
  380.             5 - align to 32 byte boundary
  381.             6 - align to 64 byte boundary
  382.       Memory flags (EHF and ADOS only):
  383.             C - load section to Chip RAM
  384.             F - load section to Fast RAM
  385.  
  386.       .set <symbol>,<expression>
  387.       --------------------------
  388.       Create a new program symbol with the name <symbol> and assign to it
  389.       the value of <expression>. If <symbol> is already assigned, it will
  390.       contain a new value from now on. If <expression> is undefined in
  391.       pass 1 (because symbols in it are defined some lines later) it will
  392.       get a default value of '1', which is changed in pass 2 to the
  393.       correct value. So it is visible for .ifdef, etc.
  394.  
  395.       .size <symbol>,<size>
  396.       ---------------------
  397.       Set the size in bytes of an object defined at <symbol>.
  398.  
  399.       .short <exp1>[,<exp2>...]
  400.       -------------------------
  401.       See ".half".
  402.  
  403.       .space <exp>
  404.       ------------
  405.       Insert <exp> zero bytes into the current section.
  406.  
  407.       .string "<string1>"[,"<string2>"...]
  408.       ------------------------------------
  409.       Assign the characters in each string along with a final zero byte
  410.       to successive memory locations in the current section.
  411.  
  412.       .type <symbol>,<type>
  413.       ---------------------
  414.       Set type of symbol called <symbol> to <type>, which must be one of:
  415.       1: Object
  416.       2: Function
  417.       3: Section
  418.       4: File
  419.       The predefined symbols @object and @function are available for
  420.       this purpose.
  421.  
  422.       .uadouble <float1>[,<float2>...]
  423.       --------------------------------
  424.       Assign the values of the operands as IEEE 754 double-precision 64-
  425.       bit format numbers to successive eight-byte areas of memory in the
  426.       current section regardless of section alignment.
  427.  
  428.       .uafloat <float1>[,<float2>...]
  429.       -------------------------------
  430.       Assign the values of the operands as IEEE 754 single precision 32-
  431.       bit format numbers to successive 4-byte areas of memory in the
  432.       current section regardless of section alignment.
  433.  
  434.       .uahalf <exp1>[,<exp2>...]
  435.       --------------------------
  436.       Assign the values of the operands into successive two byte areas of
  437.       memory in the current section regardless of section alignment.
  438.  
  439.       .ualong <exp1>[,<exp2>...]
  440.       --------------------------
  441.       See ".uaword".
  442.  
  443.       .uashort <exp1>[,<exp2>...]
  444.       ---------------------------
  445.       See ".uahalf".
  446.  
  447.       .uaword <exp1>[,<exp2>...]
  448.       --------------------------
  449.       Assign the values of the operands into successive four-byte areas
  450.       of memory in the current section regardless of section alignment.
  451.  
  452.       .word <exp1>[,<exp2>...]
  453.       ------------------------
  454.       If the current section location counter is not on a word boundary
  455.       advance it to the next word boundary. Then assign the values of the
  456.       operands into successive words of memory in the current section.
  457.  
  458.  
  459. PREDEFINED SYMBOLS
  460.       There are two symbols, which are always updated by the assembler.
  461.       $       Current address counter value.
  462.       $NARG   Number of macro arguments during macro execution.
  463.               It is zero, when outside of a macro.
  464.  
  465.       The following symbols are constant and may be deactivated by
  466.       specifying the -R option.
  467.               .set r0,0
  468.               .set r1,1
  469.               .set r2,2
  470.               .set r3,3
  471.               .set r4,4
  472.               .set r5,5
  473.               .set r6,6
  474.               .set r7,7
  475.               .set r8,8
  476.               .set r9,9
  477.               .set r10,10
  478.               .set r11,11
  479.               .set r12,12
  480.               .set r13,13
  481.               .set r14,14
  482.               .set r15,15
  483.               .set r16,16
  484.               .set r17,17
  485.               .set r18,18
  486.               .set r19,19
  487.               .set r20,20
  488.               .set r21,21
  489.               .set r22,22
  490.               .set r23,23
  491.               .set r24,24
  492.               .set r25,25
  493.               .set r26,26
  494.               .set r27,27
  495.               .set r28,28
  496.               .set r29,29
  497.               .set r30,30
  498.               .set r31,31
  499.               .set f0,0
  500.               .set f1,1
  501.               .set f2,2
  502.               .set f3,3
  503.               .set f4,4
  504.               .set f5,5
  505.               .set f6,6
  506.               .set f7,7
  507.               .set f8,8
  508.               .set f9,9
  509.               .set f10,10
  510.               .set f11,11
  511.               .set f12,12
  512.               .set f13,13
  513.               .set f14,14
  514.               .set f15,15
  515.               .set f16,16
  516.               .set f17,17
  517.               .set f18,18
  518.               .set f19,19
  519.               .set f20,20
  520.               .set f21,21
  521.               .set f22,22
  522.               .set f23,23
  523.               .set f24,24
  524.               .set f25,25
  525.               .set f26,26
  526.               .set f27,27
  527.               .set f28,28
  528.               .set f29,29
  529.               .set f30,30
  530.               .set f31,31
  531.               .set cr0,0
  532.               .set cr1,1
  533.               .set cr2,2
  534.               .set cr3,3
  535.               .set cr4,4
  536.               .set cr5,5
  537.               .set cr6,6
  538.               .set cr7,7
  539.               .set lt,0
  540.               .set gt,1
  541.               .set eq,2
  542.               .set so,3
  543.               .set un,3
  544.               .set sp,1
  545.               .set rtoc,2
  546.               .set fp,31
  547.               .set fpscr,0
  548.               .set xer,1
  549.               .set lr,8
  550.               .set ctr,9
  551.  
  552.  
  553. PREDEFINED SECTIONS
  554.         .section .text,"crx4"
  555.         .section .data,"drw4"
  556.         .section .rodata,"dr4"
  557.         .section .sdata,"drw4"
  558.         .section .sdata2,"dr4"
  559.         .section .bss,"urw4"
  560.         .section .sbss,"urw4"
  561.         .section .init,"crx4"
  562.         .section .fini,"crx4"
  563.         .section .tocd,"drw4"
  564.  
  565.  
  566. EXTENDED MNEMONICS
  567.       There is a huge set of extended mnemonics, proposed by Motorola
  568.       and IBM in the "PowerPC Programming Environments", to make the
  569.       programmer's life easier. Except for some 64-bit mnemonics (I only
  570.       downloaded the 32-bit manuals for now), pasm supports them all.
  571.  
  572.       Currently all extended mnemonics (except "la") are implemented
  573.       as macros and can be deactivated with the -X option.
  574.  
  575.       List of extended mnemonics
  576.       --------------------------
  577.       .macro subi
  578.        addi \1,\2,-(\3)
  579.       .endm
  580.       
  581.       .macro subis
  582.        addis \1,\2,-(\3)
  583.       .endm
  584.       
  585.       .macro subic
  586.        addic \1,\2,-(\3)
  587.       .endm
  588.       
  589.       .macro subic.
  590.        addic. \1,\2,-(\3)
  591.       .endm
  592.       
  593.       .macro sub
  594.        subf \1,\3,\2
  595.       .endm
  596.       
  597.       .macro sub.
  598.        subf. \1,\3,\2
  599.       .endm
  600.       
  601.       .macro subo
  602.        subfo \1,\3,\2
  603.       .endm
  604.       
  605.       .macro subo.
  606.        subfo. \1,\3,\2
  607.       .endm
  608.       
  609.       .macro subc
  610.        subfc \1,\3,\2
  611.       .endm
  612.       
  613.       .macro subc.
  614.        subfc. \1,\3,\2
  615.       .endm
  616.       
  617.       .macro subco
  618.        subfco \1,\3,\2
  619.       .endm
  620.       
  621.       .macro subco.
  622.        subfco. \1,\3,\2
  623.       .endm
  624.       
  625.       .macro cmpwi
  626.       .ifeq $NARG-2
  627.        cmpi 0,0,\1,\2
  628.       .else
  629.        cmpi \1,0,\2,\3
  630.       .endif
  631.       .endm
  632.       
  633.       .macro cmpw
  634.       .ifeq $NARG-2
  635.        cmp 0,0,\1,\2
  636.       .else
  637.        cmp \1,0,\2,\3
  638.       .endif
  639.       .endm
  640.       
  641.       .macro cmplwi
  642.       .ifeq $NARG-2
  643.        cmpli 0,0,\1,\2
  644.       .else
  645.        cmpli \1,0,\2,\3
  646.       .endif
  647.       .endm
  648.       
  649.       .macro cmplw
  650.       .ifeq $NARG-2
  651.        cmpl 0,0,\1,\2
  652.       .else
  653.        cmpl \1,0,\2,\3
  654.       .endif
  655.       .endm
  656.       
  657.       .macro cmpdi
  658.       .ifeq $NARG-2
  659.        cmpi 0,1,\1,\2
  660.       .else
  661.        cmpi \1,1,\2,\3
  662.       .endif
  663.       .endm
  664.       
  665.       .macro cmpd
  666.       .ifeq $NARG-2
  667.        cmp 0,1,\1,\2
  668.       .else
  669.        cmp \1,1,\2,\3
  670.       .endif
  671.       .endm
  672.       
  673.       .macro cmpldi
  674.       .ifeq $NARG-2
  675.        cmpli 0,1,\1,\2
  676.       .else
  677.        cmpli \1,1,\2,\3
  678.       .endif
  679.       .endm
  680.       
  681.       .macro cmpld
  682.       .ifeq $NARG-2
  683.        cmpl 0,1,\1,\2
  684.       .else
  685.        cmpl \1,1,\2,\3
  686.       .endif
  687.       .endm
  688.       
  689.       
  690.       .macro extlwi
  691.        rlwinm \1,\2,\4,0,(\3)-1
  692.       .endm
  693.       
  694.       .macro extlwi.
  695.        rlwinm. \1,\2,\4,0,(\3)-1
  696.       .endm
  697.       
  698.       .macro extrwi
  699.        rlwinm \1,\2,(\4)+(\3),32-(\3),31
  700.       .endm
  701.       
  702.       .macro extrwi.
  703.        rlwinm. \1,\2,(\4)+(\3),32-(\3),31
  704.       .endm
  705.       
  706.       .macro inslwi
  707.        rlwimi \1,\2,32-(\4),\4,((\4)+(\3))-1
  708.       .endm
  709.       
  710.       .macro inslwi.
  711.        rlwimi. \1,\2,32-(\4),\4,((\4)+(\3))-1
  712.       .endm
  713.       
  714.       .macro insrwi
  715.        rlwimi \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  716.       .endm
  717.       
  718.       .macro insrwi.
  719.        rlwimi. \1,\2,32-((\4)+(\3)),\4,((\4)+(\3))-1
  720.       .endm
  721.       
  722.       .macro rotlwi
  723.        rlwinm \1,\2,\3,0,31
  724.       .endm
  725.       
  726.       .macro rotlwi.
  727.        rlwinm. \1,\2,\3,0,31
  728.       .endm
  729.       
  730.       .macro rotrwi
  731.        rlwinm \1,\2,32-(\3),0,31
  732.       .endm
  733.       
  734.       .macro rotrwi.
  735.        rlwinm. \1,\2,32-(\3),0,31
  736.       .endm
  737.       
  738.       .macro rotlw
  739.        rlwnm \1,\2,\3,0,31
  740.       .endm
  741.       
  742.       .macro rotlw.
  743.        rlwnm. \1,\2,\3,0,31
  744.       .endm
  745.       
  746.       .macro slwi
  747.        rlwinm \1,\2,\3,0,31-(\3)
  748.       .endm
  749.       
  750.       .macro slwi.
  751.        rlwinm. \1,\2,\3,0,31-(\3)
  752.       .endm
  753.       
  754.       .macro srwi
  755.        rlwinm \1,\2,32-(\3),\3,31
  756.       .endm
  757.       
  758.       .macro srwi.
  759.        rlwinm. \1,\2,32-(\3),\3,31
  760.       .endm
  761.       
  762.       .macro clrlwi
  763.        rlwinm \1,\2,0,\3,31
  764.       .endm
  765.       
  766.       .macro clrlwi.
  767.        rlwinm. \1,\2,0,\3,31
  768.       .endm
  769.       
  770.       .macro clrrwi
  771.        rlwinm \1,\2,0,0,31-(\3)
  772.       .endm
  773.       
  774.       .macro clrrwi.
  775.        rlwinm. \1,\2,0,0,31-(\3)
  776.       .endm
  777.       
  778.       .macro clrlslwi
  779.        rlwinm \1,\2,\4,(\3)-(\4),31-(\4)
  780.       .endm
  781.       
  782.       .macro clrlslwi.
  783.        rlwinm. \1,\2,\4,(\3)-(\4),31-(\4)
  784.       .endm
  785.       
  786.       
  787.       .macro bt
  788.        bc\0 12,\1,\2
  789.       .endm
  790.       
  791.       .macro bf
  792.        bc\0 4,\1,\2
  793.       .endm
  794.       
  795.       .macro bdnz
  796.        bc\0 16,0,\1
  797.       .endm
  798.       
  799.       .macro bdnzt
  800.        bc\0 8,\1,\2
  801.       .endm
  802.       
  803.       .macro bdnzf
  804.        bc\0 0,\1,\2
  805.       .endm
  806.       
  807.       .macro bdz
  808.        bc\0 18,0,\1
  809.       .endm
  810.       
  811.       .macro bdzt
  812.        bc\0 10,\1,\2
  813.       .endm
  814.       
  815.       .macro bdzf
  816.        bc\0 2,\1,\2
  817.       .endm
  818.       
  819.       .macro bta
  820.        bca\0 12,\1,\2
  821.       .endm
  822.       
  823.       .macro bfa
  824.        bca\0 4,\1,\2
  825.       .endm
  826.       
  827.       .macro bdnza
  828.        bca\0 16,0,\1
  829.       .endm
  830.       
  831.       .macro bdnzta
  832.        bca\0 8,\1,\2
  833.       .endm
  834.       
  835.       .macro bdnzfa
  836.        bca\0 0,\1,\2
  837.       .endm
  838.       
  839.       .macro bdza
  840.        bca\0 18,0,\1
  841.       .endm
  842.       
  843.       .macro bdzta
  844.        bca\0 10,\1,\2
  845.       .endm
  846.       
  847.       .macro bdzfa
  848.        bca\0 2,\1,\2
  849.       .endm
  850.       
  851.       .macro blr
  852.        bclr 20,0
  853.       .endm
  854.       
  855.       .macro btlr
  856.        bclr\0 12,\1
  857.       .endm
  858.       
  859.       .macro bflr
  860.        bclr\0 4,\1
  861.       .endm
  862.       
  863.       .macro bdnzlr
  864.        bclr\0 16,0
  865.       .endm
  866.       
  867.       .macro bdnztlr
  868.        bclr\0 8,\1
  869.       .endm
  870.       
  871.       .macro bdnzflr
  872.        bclr\0 0,\1
  873.       .endm
  874.       
  875.       .macro bdzlr
  876.        bclr\0 18,0
  877.       .endm
  878.       
  879.       .macro bdztlr
  880.        bclr\0 10,\1
  881.       .endm
  882.       
  883.       .macro bdzflr
  884.        bclr\0 2,\1
  885.       .endm
  886.       
  887.       .macro bctr
  888.        bcctr 20,0
  889.       .endm
  890.       
  891.       .macro btctr
  892.        bcctr\0 12,\1
  893.       .endm
  894.       
  895.       .macro bfctr
  896.        bcctr\0 4,\1
  897.       .endm
  898.       
  899.       .macro btl
  900.        bcl\0 12,\1,\2
  901.       .endm
  902.       
  903.       .macro bfl
  904.        bcl\0 4,\1,\2
  905.       .endm
  906.       
  907.       .macro bdnzl
  908.        bcl\0 16,0,\1
  909.       .endm
  910.       
  911.       .macro bdnztl
  912.        bcl\0 8,\1,\2
  913.       .endm
  914.       
  915.       .macro bdnzfl
  916.        bcl\0 0,\1,\2
  917.       .endm
  918.       
  919.       .macro bdzl
  920.        bcl\0 18,0,\1
  921.       .endm
  922.       
  923.       .macro bdztl
  924.        bcl\0 10,\1,\2
  925.       .endm
  926.       
  927.       .macro bdzfl
  928.        bcl\0 2,\1,\2
  929.       .endm
  930.       
  931.       .macro btla
  932.        bcla\0 12,\1,\2
  933.       .endm
  934.       
  935.       .macro bfla
  936.        bcla\0 4,\1,\2
  937.       .endm
  938.       
  939.       .macro bdnzla
  940.        bcla\0 16,0,\1
  941.       .endm
  942.       
  943.       .macro bdnztla
  944.        bcla\0 8,\1,\2
  945.       .endm
  946.       
  947.       .macro bdnzfla
  948.        bcla\0 0,\1,\2
  949.       .endm
  950.       
  951.       .macro bdzla
  952.        bcla\0 18,0,\1
  953.       .endm
  954.       
  955.       .macro bdztla
  956.        bcla\0 10,\1,\2
  957.       .endm
  958.       
  959.       .macro bdzfla
  960.        bcla\0 2,\1,\2
  961.       .endm
  962.       
  963.       .macro blrl
  964.        bclrl 20,0
  965.       .endm
  966.       
  967.       .macro btlrl
  968.        bclrl\0 12,\1
  969.       .endm
  970.       
  971.       .macro bflrl
  972.        bclrl\0 4,\1
  973.       .endm
  974.       
  975.       .macro bdnzlrl
  976.        bclrl\0 16,0
  977.       .endm
  978.       
  979.       .macro bdnztlrl
  980.        bclrl\0 8,\1
  981.       .endm
  982.       
  983.       .macro bdnzflrl
  984.        bclrl\0 0,\1
  985.       .endm
  986.       
  987.       .macro bdzlrl
  988.        bclrl\0 18,0
  989.       .endm
  990.       
  991.       .macro bdztlrl
  992.        bclrl\0 10,\1
  993.       .endm
  994.       
  995.       .macro bdzflrl
  996.        bclrl\0 2,\1
  997.       .endm
  998.       
  999.       .macro bctrl
  1000.        bcctrl 20,0
  1001.       .endm
  1002.       
  1003.       .macro btctrl
  1004.        bcctrl\0 12,\1
  1005.       .endm
  1006.       
  1007.       .macro bfctrl
  1008.        bcctrl\0 4,\1
  1009.       .endm
  1010.       
  1011.       
  1012.       .macro blt
  1013.       .ifeq $NARG-1
  1014.        bc\0 12,0,\1
  1015.       .else
  1016.        bc\0 12,4*(\1)+0,\2
  1017.       .endif
  1018.       .endm
  1019.       
  1020.       .macro ble
  1021.       .ifeq $NARG-1
  1022.        bc\0 4,1,\1
  1023.       .else
  1024.        bc\0 4,4*(\1)+1,\2
  1025.       .endif
  1026.       .endm
  1027.       
  1028.       .macro beq
  1029.       .ifeq $NARG-1
  1030.        bc\0 12,2,\1
  1031.       .else
  1032.        bc\0 12,4*(\1)+2,\2
  1033.       .endif
  1034.       .endm
  1035.       
  1036.       .macro bge
  1037.       .ifeq $NARG-1
  1038.        bc\0 4,0,\1
  1039.       .else
  1040.        bc\0 4,4*(\1)+0,\2
  1041.       .endif
  1042.       .endm
  1043.       
  1044.       .macro bgt
  1045.       .ifeq $NARG-1
  1046.        bc\0 12,1,\1
  1047.       .else
  1048.        bc\0 12,4*(\1)+1,\2
  1049.       .endif
  1050.       .endm
  1051.       
  1052.       .macro bnl
  1053.       .ifeq $NARG-1
  1054.        bc\0 4,0,\1
  1055.       .else
  1056.        bc\0 4,4*(\1)+0,\2
  1057.       .endif
  1058.       .endm
  1059.       
  1060.       .macro bne
  1061.       .ifeq $NARG-1
  1062.        bc\0 4,2,\1
  1063.       .else
  1064.        bc\0 4,4*(\1)+2,\2
  1065.       .endif
  1066.       .endm
  1067.       
  1068.       .macro bng
  1069.       .ifeq $NARG-1
  1070.        bc\0 4,1,\1
  1071.       .else
  1072.        bc\0 4,4*(\1)+1,\2
  1073.       .endif
  1074.       .endm
  1075.       
  1076.       .macro bso
  1077.       .ifeq $NARG-1
  1078.        bc\0 12,3,\1
  1079.       .else
  1080.        bc\0 12,4*(\1)+3,\2
  1081.       .endif
  1082.       .endm
  1083.       
  1084.       .macro bns
  1085.       .ifeq $NARG-1
  1086.        bc\0 4,3,\1
  1087.       .else
  1088.        bc\0 4,4*(\1)+3,\2
  1089.       .endif
  1090.       .endm
  1091.       
  1092.       .macro bun
  1093.       .ifeq $NARG-1
  1094.        bc\0 12,3,\1
  1095.       .else
  1096.        bc\0 12,4*(\1)+3,\2
  1097.       .endif
  1098.       .endm
  1099.       
  1100.       .macro bnu
  1101.       .ifeq $NARG-1
  1102.        bc\0 4,3,\1
  1103.       .else
  1104.        bc\0 4,4*(\1)+3,\2
  1105.       .endif
  1106.       .endm
  1107.       
  1108.       .macro blta
  1109.       .ifeq $NARG-1
  1110.        bca\0 12,0,\1
  1111.       .else
  1112.        bca\0 12,4*(\1)+0,\2
  1113.       .endif
  1114.       .endm
  1115.       
  1116.       .macro blea
  1117.       .ifeq $NARG-1
  1118.        bca\0 4,1,\1
  1119.       .else
  1120.        bca\0 4,4*(\1)+1,\2
  1121.       .endif
  1122.       .endm
  1123.       
  1124.       .macro beqa
  1125.       .ifeq $NARG-1
  1126.        bca\0 12,2,\1
  1127.       .else
  1128.        bca\0 12,4*(\1)+2,\2
  1129.       .endif
  1130.       .endm
  1131.       
  1132.       .macro bgea
  1133.       .ifeq $NARG-1
  1134.        bca\0 4,0,\1
  1135.       .else
  1136.        bca\0 4,4*(\1)+0,\2
  1137.       .endif
  1138.       .endm
  1139.       
  1140.       .macro bgta
  1141.       .ifeq $NARG-1
  1142.        bca\0 12,1,\1
  1143.       .else
  1144.        bca\0 12,4*(\1)+1,\2
  1145.       .endif
  1146.       .endm
  1147.       
  1148.       .macro bnla
  1149.       .ifeq $NARG-1
  1150.        bca\0 4,0,\1
  1151.       .else
  1152.        bca\0 4,4*(\1)+0,\2
  1153.       .endif
  1154.       .endm
  1155.       
  1156.       .macro bnea
  1157.       .ifeq $NARG-1
  1158.        bca\0 4,2,\1
  1159.       .else
  1160.        bca\0 4,4*(\1)+2,\2
  1161.       .endif
  1162.       .endm
  1163.       
  1164.       .macro bnga
  1165.       .ifeq $NARG-1
  1166.        bca\0 4,1,\1
  1167.       .else
  1168.        bca\0 4,4*(\1)+1,\2
  1169.       .endif
  1170.       .endm
  1171.       
  1172.       .macro bsoa
  1173.       .ifeq $NARG-1
  1174.        bca\0 12,3,\1
  1175.       .else
  1176.        bca\0 12,4*(\1)+3,\2
  1177.       .endif
  1178.       .endm
  1179.       
  1180.       .macro bnsa
  1181.       .ifeq $NARG-1
  1182.        bca\0 4,3,\1
  1183.       .else
  1184.        bca\0 4,4*(\1)+3,\2
  1185.       .endif
  1186.       .endm
  1187.       
  1188.       .macro buna
  1189.       .ifeq $NARG-1
  1190.        bca\0 12,3,\1
  1191.       .else
  1192.        bca\0 12,4*(\1)+3,\2
  1193.       .endif
  1194.       .endm
  1195.       
  1196.       .macro bnua
  1197.       .ifeq $NARG-1
  1198.        bca\0 4,3,\1
  1199.       .else
  1200.        bca\0 4,4*(\1)+3,\2
  1201.       .endif
  1202.       .endm
  1203.       
  1204.       
  1205.       .macro bltlr
  1206.       .ifeq $NARG-1
  1207.        bclr\0 12,4*(\1)+0
  1208.       .else
  1209.        bclr\0 12,0
  1210.       .endif
  1211.       .endm
  1212.       
  1213.       .macro blelr
  1214.       .ifeq $NARG-1
  1215.        bclr\0 4,4*(\1)+1
  1216.       .else
  1217.        bclr\0 4,1
  1218.       .endif
  1219.       .endm
  1220.       
  1221.       .macro beqlr
  1222.       .ifeq $NARG-1
  1223.        bclr\0 12,4*(\1)+2
  1224.       .else
  1225.        bclr\0 12,2
  1226.       .endif
  1227.       .endm
  1228.       
  1229.       .macro bgelr
  1230.       .ifeq $NARG-1
  1231.        bclr\0 4,4*(\1)+0
  1232.       .else
  1233.        bclr\0 4,0
  1234.       .endif
  1235.       .endm
  1236.       
  1237.       .macro bgtlr
  1238.       .ifeq $NARG-1
  1239.        bclr\0 12,4*(\1)+1
  1240.       .else
  1241.        bclr\0 12,1
  1242.       .endif
  1243.       .endm
  1244.       
  1245.       .macro bnllr
  1246.       .ifeq $NARG-1
  1247.        bclr\0 4,4*(\1)+0
  1248.       .else
  1249.        bclr\0 4,0
  1250.       .endif
  1251.       .endm
  1252.       
  1253.       .macro bnelr
  1254.       .ifeq $NARG-1
  1255.        bclr\0 4,4*(\1)+2
  1256.       .else
  1257.        bclr\0 4,2
  1258.       .endif
  1259.       .endm
  1260.       
  1261.       .macro bnglr
  1262.       .ifeq $NARG-1
  1263.        bclr\0 4,4*(\1)+1
  1264.       .else
  1265.        bclr\0 4,1
  1266.       .endif
  1267.       .endm
  1268.       
  1269.       .macro bsolr
  1270.       .ifeq $NARG-1
  1271.        bclr\0 12,4*(\1)+3
  1272.       .else
  1273.        bclr\0 12,3
  1274.       .endif
  1275.       .endm
  1276.       
  1277.       .macro bnslr
  1278.       .ifeq $NARG-1
  1279.        bclr\0 4,4*(\1)+3
  1280.       .else
  1281.        bclr\0 4,3
  1282.       .endif
  1283.       .endm
  1284.       
  1285.       .macro bunlr
  1286.       .ifeq $NARG-1
  1287.        bclr\0 12,4*(\1)+3
  1288.       .else
  1289.        bclr\0 12,3
  1290.       .endif
  1291.       .endm
  1292.       
  1293.       .macro bnulr
  1294.       .ifeq $NARG-1
  1295.        bclr\0 4,4*(\1)+3
  1296.       .else
  1297.        bclr\0 4,3
  1298.       .endif
  1299.       .endm
  1300.       
  1301.       .macro bltctr
  1302.       .ifeq $NARG-1
  1303.        bcctr\0 12,4*(\1)+0
  1304.       .else
  1305.        bcctr\0 12,0
  1306.       .endif
  1307.       .endm
  1308.       
  1309.       .macro blectr
  1310.       .ifeq $NARG-1
  1311.        bcctr\0 4,4*(\1)+1
  1312.       .else
  1313.        bcctr\0 4,1
  1314.       .endif
  1315.       .endm
  1316.       
  1317.       .macro beqctr
  1318.       .ifeq $NARG-1
  1319.        bcctr\0 12,4*(\1)+2
  1320.       .else
  1321.        bcctr\0 12,2
  1322.       .endif
  1323.       .endm
  1324.       
  1325.       .macro bgectr
  1326.       .ifeq $NARG-1
  1327.        bcctr\0 4,4*(\1)+0
  1328.       .else
  1329.        bcctr\0 4,0
  1330.       .endif
  1331.       .endm
  1332.       
  1333.       .macro bgtctr
  1334.       .ifeq $NARG-1
  1335.        bcctr\0 12,4*(\1)+1
  1336.       .else
  1337.        bcctr\0 12,1
  1338.       .endif
  1339.       .endm
  1340.       
  1341.       .macro bnlctr
  1342.       .ifeq $NARG-1
  1343.        bcctr\0 4,4*(\1)+0
  1344.       .else
  1345.        bcctr\0 4,0
  1346.       .endif
  1347.       .endm
  1348.       
  1349.       .macro bnectr
  1350.       .ifeq $NARG-1
  1351.        bcctr\0 4,4*(\1)+2
  1352.       .else
  1353.        bcctr\0 4,2
  1354.       .endif
  1355.       .endm
  1356.       
  1357.       .macro bngctr
  1358.       .ifeq $NARG-1
  1359.        bcctr\0 4,4*(\1)+1
  1360.       .else
  1361.        bcctr\0 4,1
  1362.       .endif
  1363.       .endm
  1364.       
  1365.       .macro bsoctr
  1366.       .ifeq $NARG-1
  1367.        bcctr\0 12,4*(\1)+3
  1368.       .else
  1369.        bcctr\0 12,3
  1370.       .endif
  1371.       .endm
  1372.       
  1373.       .macro bnsctr
  1374.       .ifeq $NARG-1
  1375.        bcctr\0 4,4*(\1)+3
  1376.       .else
  1377.        bcctr\0 4,3
  1378.       .endif
  1379.       .endm
  1380.       
  1381.       .macro bunctr
  1382.       .ifeq $NARG-1
  1383.        bcctr\0 12,4*(\1)+3
  1384.       .else
  1385.        bcctr\0 12,3
  1386.       .endif
  1387.       .endm
  1388.       
  1389.       .macro bnuctr
  1390.       .ifeq $NARG-1
  1391.        bcctr\0 4,4*(\1)+3
  1392.       .else
  1393.        bcctr\0 4,3
  1394.       .endif
  1395.       .endm
  1396.       
  1397.       
  1398.       .macro bltl
  1399.       .ifeq $NARG-1
  1400.        bcl\0 12,0,\1
  1401.       .else
  1402.        bcl\0 12,4*(\1)+0,\2
  1403.       .endif
  1404.       .endm
  1405.       
  1406.       .macro blel
  1407.       .ifeq $NARG-1
  1408.        bcl\0 4,1,\1
  1409.       .else
  1410.        bcl\0 4,4*(\1)+1,\2
  1411.       .endif
  1412.       .endm
  1413.       
  1414.       .macro beql
  1415.       .ifeq $NARG-1
  1416.        bcl\0 12,2,\1
  1417.       .else
  1418.        bcl\0 12,4*(\1)+2,\2
  1419.       .endif
  1420.       .endm
  1421.       
  1422.       .macro bgel
  1423.       .ifeq $NARG-1
  1424.        bcl\0 4,0,\1
  1425.       .else
  1426.        bcl\0 4,4*(\1)+0,\2
  1427.       .endif
  1428.       .endm
  1429.       
  1430.       .macro bgtl
  1431.       .ifeq $NARG-1
  1432.        bcl\0 12,1,\1
  1433.       .else
  1434.        bcl\0 12,4*(\1)+1,\2
  1435.       .endif
  1436.       .endm
  1437.       
  1438.       .macro bnll
  1439.       .ifeq $NARG-1
  1440.        bcl\0 4,0,\1
  1441.       .else
  1442.        bcl\0 4,4*(\1)+0,\2
  1443.       .endif
  1444.       .endm
  1445.       
  1446.       .macro bnel
  1447.       .ifeq $NARG-1
  1448.        bcl\0 4,2,\1
  1449.       .else
  1450.        bcl\0 4,4*(\1)+2,\2
  1451.       .endif
  1452.       .endm
  1453.       
  1454.       .macro bngl
  1455.       .ifeq $NARG-1
  1456.        bcl\0 4,1,\1
  1457.       .else
  1458.        bcl\0 4,4*(\1)+1,\2
  1459.       .endif
  1460.       .endm
  1461.       
  1462.       .macro bsol
  1463.       .ifeq $NARG-1
  1464.        bcl\0 12,3,\1
  1465.       .else
  1466.        bcl\0 12,4*(\1)+3,\2
  1467.       .endif
  1468.       .endm
  1469.       
  1470.       .macro bnsl
  1471.       .ifeq $NARG-1
  1472.        bcl\0 4,3,\1
  1473.       .else
  1474.        bcl\0 4,4*(\1)+3,\2
  1475.       .endif
  1476.       .endm
  1477.       
  1478.       .macro bunl
  1479.       .ifeq $NARG-1
  1480.        bcl\0 12,3,\1
  1481.       .else
  1482.        bcl\0 12,4*(\1)+3,\2
  1483.       .endif
  1484.       .endm
  1485.       
  1486.       .macro bnul
  1487.       .ifeq $NARG-1
  1488.        bcl\0 4,3,\1
  1489.       .else
  1490.        bcl\0 4,4*(\1)+3,\2
  1491.       .endif
  1492.       .endm
  1493.       
  1494.       .macro bltla
  1495.       .ifeq $NARG-1
  1496.        bcla\0 12,0,\1
  1497.       .else
  1498.        bcla\0 12,4*(\1)+0,\2
  1499.       .endif
  1500.       .endm
  1501.       
  1502.       .macro blela
  1503.       .ifeq $NARG-1
  1504.        bcla\0 4,1,\1
  1505.       .else
  1506.        bcla\0 4,4*(\1)+1,\2
  1507.       .endif
  1508.       .endm
  1509.       
  1510.       .macro beqla
  1511.       .ifeq $NARG-1
  1512.        bcla\0 12,2,\1
  1513.       .else
  1514.        bcla\0 12,4*(\1)+2,\2
  1515.       .endif
  1516.       .endm
  1517.       
  1518.       .macro bgela
  1519.       .ifeq $NARG-1
  1520.        bcla\0 4,0,\1
  1521.       .else
  1522.        bcla\0 4,4*(\1)+0,\2
  1523.       .endif
  1524.       .endm
  1525.       
  1526.       .macro bgtla
  1527.       .ifeq $NARG-1
  1528.        bcla\0 12,1,\1
  1529.       .else
  1530.        bcla\0 12,4*(\1)+1,\2
  1531.       .endif
  1532.       .endm
  1533.       
  1534.       .macro bnlla
  1535.       .ifeq $NARG-1
  1536.        bcla\0 4,0,\1
  1537.       .else
  1538.        bcla\0 4,4*(\1)+0,\2
  1539.       .endif
  1540.       .endm
  1541.       
  1542.       .macro bnela
  1543.       .ifeq $NARG-1
  1544.        bcla\0 4,2,\1
  1545.       .else
  1546.        bcla\0 4,4*(\1)+2,\2
  1547.       .endif
  1548.       .endm
  1549.       
  1550.       .macro bngla
  1551.       .ifeq $NARG-1
  1552.        bcla\0 4,1,\1
  1553.       .else
  1554.        bcla\0 4,4*(\1)+1,\2
  1555.       .endif
  1556.       .endm
  1557.       
  1558.       .macro bsola
  1559.       .ifeq $NARG-1
  1560.        bcla\0 12,3,\1
  1561.       .else
  1562.        bcla\0 12,4*(\1)+3,\2
  1563.       .endif
  1564.       .endm
  1565.       
  1566.       .macro bnsla
  1567.       .ifeq $NARG-1
  1568.        bcla\0 4,3,\1
  1569.       .else
  1570.        bcla\0 4,4*(\1)+3,\2
  1571.       .endif
  1572.       .endm
  1573.       
  1574.       .macro bunla
  1575.       .ifeq $NARG-1
  1576.        bcla\0 12,3,\1
  1577.       .else
  1578.        bcla\0 12,4*(\1)+3,\2
  1579.       .endif
  1580.       .endm
  1581.       
  1582.       .macro bnula
  1583.       .ifeq $NARG-1
  1584.        bcla\0 4,3,\1
  1585.       .else
  1586.        bcla\0 4,4*(\1)+3,\2
  1587.       .endif
  1588.       .endm
  1589.       
  1590.       
  1591.       .macro bltlrl
  1592.       .ifeq $NARG-1
  1593.        bclrl\0 12,4*(\1)+0
  1594.       .else
  1595.        bclrl\0 12,0
  1596.       .endif
  1597.       .endm
  1598.       
  1599.       .macro blelrl
  1600.       .ifeq $NARG-1
  1601.        bclrl\0 4,4*(\1)+1
  1602.       .else
  1603.        bclrl\0 4,1
  1604.       .endif
  1605.       .endm
  1606.       
  1607.       .macro beqlrl
  1608.       .ifeq $NARG-1
  1609.        bclrl\0 12,4*(\1)+2
  1610.       .else
  1611.        bclrl\0 12,2
  1612.       .endif
  1613.       .endm
  1614.       
  1615.       .macro bgelrl
  1616.       .ifeq $NARG-1
  1617.        bclrl\0 4,4*(\1)+0
  1618.       .else
  1619.        bclrl\0 4,0
  1620.       .endif
  1621.       .endm
  1622.       
  1623.       .macro bgtlrl
  1624.       .ifeq $NARG-1
  1625.        bclrl\0 12,4*(\1)+1
  1626.       .else
  1627.        bclrl\0 12,1
  1628.       .endif
  1629.       .endm
  1630.       
  1631.       .macro bnllrl
  1632.       .ifeq $NARG-1
  1633.        bclrl\0 4,4*(\1)+0
  1634.       .else
  1635.        bclrl\0 4,0
  1636.       .endif
  1637.       .endm
  1638.       
  1639.       .macro bnelrl
  1640.       .ifeq $NARG-1
  1641.        bclrl\0 4,4*(\1)+2
  1642.       .else
  1643.        bclrl\0 4,2
  1644.       .endif
  1645.       .endm
  1646.       
  1647.       .macro bnglrl
  1648.       .ifeq $NARG-1
  1649.        bclrl\0 4,4*(\1)+1
  1650.       .else
  1651.        bclrl\0 4,1
  1652.       .endif
  1653.       .endm
  1654.       
  1655.       .macro bsolrl
  1656.       .ifeq $NARG-1
  1657.        bclrl\0 12,4*(\1)+3
  1658.       .else
  1659.        bclrl\0 12,3
  1660.       .endif
  1661.       .endm
  1662.       
  1663.       .macro bnslrl
  1664.       .ifeq $NARG-1
  1665.        bclrl\0 4,4*(\1)+3
  1666.       .else
  1667.        bclrl\0 4,3
  1668.       .endif
  1669.       .endm
  1670.       
  1671.       .macro bunlrl
  1672.       .ifeq $NARG-1
  1673.        bclrl\0 12,4*(\1)+3
  1674.       .else
  1675.        bclrl\0 12,3
  1676.       .endif
  1677.       .endm
  1678.       
  1679.       .macro bnulrl
  1680.       .ifeq $NARG-1
  1681.        bclrl\0 4,4*(\1)+3
  1682.       .else
  1683.        bclrl\0 4,3
  1684.       .endif
  1685.       .endm
  1686.       
  1687.       .macro bltctrl
  1688.       .ifeq $NARG-1
  1689.        bcctrl\0 12,4*(\1)+0
  1690.       .else
  1691.        bcctrl\0 12,0
  1692.       .endif
  1693.       .endm
  1694.       
  1695.       .macro blectrl
  1696.       .ifeq $NARG-1
  1697.        bcctrl\0 4,4*(\1)+1
  1698.       .else
  1699.        bcctrl\0 4,1
  1700.       .endif
  1701.       .endm
  1702.       
  1703.       .macro beqctrl
  1704.       .ifeq $NARG-1
  1705.        bcctrl\0 12,4*(\1)+2
  1706.       .else
  1707.        bcctrl\0 12,2
  1708.       .endif
  1709.       .endm
  1710.       
  1711.       .macro bgectrl
  1712.       .ifeq $NARG-1
  1713.        bcctrl\0 4,4*(\1)+0
  1714.       .else
  1715.        bcctrl\0 4,0
  1716.       .endif
  1717.       .endm
  1718.       
  1719.       .macro bgtctrl
  1720.       .ifeq $NARG-1
  1721.        bcctrl\0 12,4*(\1)+1
  1722.       .else
  1723.        bcctrl\0 12,1
  1724.       .endif
  1725.       .endm
  1726.       
  1727.       .macro bnlctrl
  1728.       .ifeq $NARG-1
  1729.        bcctrl\0 4,4*(\1)+0
  1730.       .else
  1731.        bcctrl\0 4,0
  1732.       .endif
  1733.       .endm
  1734.       
  1735.       .macro bnectrl
  1736.       .ifeq $NARG-1
  1737.        bcctrl\0 4,4*(\1)+2
  1738.       .else
  1739.        bcctrl\0 4,2
  1740.       .endif
  1741.       .endm
  1742.       
  1743.       .macro bngctrl
  1744.       .ifeq $NARG-1
  1745.        bcctrl\0 4,4*(\1)+1
  1746.       .else
  1747.        bcctrl\0 4,1
  1748.       .endif
  1749.       .endm
  1750.       
  1751.       .macro bsoctrl
  1752.       .ifeq $NARG-1
  1753.        bcctrl\0 12,4*(\1)+3
  1754.       .else
  1755.        bcctrl\0 12,3
  1756.       .endif
  1757.       .endm
  1758.       
  1759.       .macro bnsctrl
  1760.       .ifeq $NARG-1
  1761.        bcctrl\0 4,4*(\1)+3
  1762.       .else
  1763.        bcctrl\0 4,3
  1764.       .endif
  1765.       .endm
  1766.       
  1767.       .macro bunctrl
  1768.       .ifeq $NARG-1
  1769.        bcctrl\0 12,4*(\1)+3
  1770.       .else
  1771.        bcctrl\0 12,3
  1772.       .endif
  1773.       .endm
  1774.       
  1775.       .macro bnuctrl
  1776.       .ifeq $NARG-1
  1777.        bcctrl\0 4,4*(\1)+3
  1778.       .else
  1779.        bcctrl\0 4,3
  1780.       .endif
  1781.       .endm
  1782.       
  1783.       
  1784.       .macro crset
  1785.        creqv \1,\1,\1
  1786.       .endm
  1787.       
  1788.       .macro crclr
  1789.        crxor \1,\1,\1
  1790.       .endm
  1791.       
  1792.       .macro crmove
  1793.        cror \1,\2,\2
  1794.       .endm
  1795.       
  1796.       .macro crnot
  1797.        crnor \1,\2,\2
  1798.       .endm
  1799.       
  1800.       
  1801.       .macro trap
  1802.        tw 31,0,0
  1803.       .endm
  1804.       
  1805.       .macro twlt
  1806.        tw 16,\1,\2
  1807.       .endm
  1808.       
  1809.       .macro twle
  1810.        tw 20,\1,\2
  1811.       .endm
  1812.       
  1813.       .macro tweq
  1814.        tw 4,\1,\2
  1815.       .endm
  1816.       
  1817.       .macro twge
  1818.        tw 12,\1,\2
  1819.       .endm
  1820.       
  1821.       .macro twgt
  1822.        tw 8,\1,\2
  1823.       .endm
  1824.       
  1825.       .macro twnl
  1826.        tw 12,\1,\2
  1827.       .endm
  1828.       
  1829.       .macro twne
  1830.        tw 24,\1,\2
  1831.       .endm
  1832.       
  1833.       .macro twng
  1834.        tw 20,\1,\2
  1835.       .endm
  1836.       
  1837.       .macro twllt
  1838.        tw 2,\1,\2
  1839.       .endm
  1840.       
  1841.       .macro twlle
  1842.        tw 6,\1,\2
  1843.       .endm
  1844.       
  1845.       .macro twlge
  1846.        tw 5,\1,\2
  1847.       .endm
  1848.       
  1849.       .macro twlgt
  1850.        tw 1,\1,\2
  1851.       .endm
  1852.       
  1853.       .macro twlnl
  1854.        tw 5,\1,\2
  1855.       .endm
  1856.       
  1857.       .macro twlng
  1858.        tw 6,\1,\2
  1859.       .endm
  1860.       
  1861.       .macro twlti
  1862.        twi 16,\1,\2
  1863.       .endm
  1864.       
  1865.       .macro twlei
  1866.        twi 20,\1,\2
  1867.       .endm
  1868.       
  1869.       .macro tweqi
  1870.        twi 4,\1,\2
  1871.       .endm
  1872.       
  1873.       .macro twgei
  1874.        twi 12,\1,\2
  1875.       .endm
  1876.       
  1877.       .macro twgti
  1878.        twi 8,\1,\2
  1879.       .endm
  1880.       
  1881.       .macro twnli
  1882.        twi 12,\1,\2
  1883.       .endm
  1884.       
  1885.       .macro twnei
  1886.        twi 24,\1,\2
  1887.       .endm
  1888.       
  1889.       .macro twngi
  1890.        twi 20,\1,\2
  1891.       .endm
  1892.       
  1893.       .macro twllti
  1894.        twi 2,\1,\2
  1895.       .endm
  1896.       
  1897.       .macro twllei
  1898.        twi 6,\1,\2
  1899.       .endm
  1900.       
  1901.       .macro twlgei
  1902.        twi 5,\1,\2
  1903.       .endm
  1904.       
  1905.       .macro twlgti
  1906.        twi 1,\1,\2
  1907.       .endm
  1908.       
  1909.       .macro twlnli
  1910.        twi 5,\1,\2
  1911.       .endm
  1912.       
  1913.       .macro twlngi
  1914.        twi 6,\1,\2
  1915.       .endm
  1916.       
  1917.       .macro tdlt
  1918.        td 16,\1,\2
  1919.       .endm
  1920.       
  1921.       .macro tdle
  1922.        td 20,\1,\2
  1923.       .endm
  1924.       
  1925.       .macro tdeq
  1926.        td 4,\1,\2
  1927.       .endm
  1928.       
  1929.       .macro tdge
  1930.        td 12,\1,\2
  1931.       .endm
  1932.       
  1933.       .macro tdgt
  1934.        td 8,\1,\2
  1935.       .endm
  1936.       
  1937.       .macro tdnl
  1938.        td 12,\1,\2
  1939.       .endm
  1940.       
  1941.       .macro tdne
  1942.        td 24,\1,\2
  1943.       .endm
  1944.       
  1945.       .macro tdng
  1946.        td 20,\1,\2
  1947.       .endm
  1948.       
  1949.       .macro tdllt
  1950.        td 2,\1,\2
  1951.       .endm
  1952.       
  1953.       .macro tdlle
  1954.        td 6,\1,\2
  1955.       .endm
  1956.       
  1957.       .macro tdlge
  1958.        td 5,\1,\2
  1959.       .endm
  1960.       
  1961.       .macro tdlgt
  1962.        td 1,\1,\2
  1963.       .endm
  1964.       
  1965.       .macro tdlnl
  1966.        td 5,\1,\2
  1967.       .endm
  1968.       
  1969.       .macro tdlng
  1970.        td 6,\1,\2
  1971.       .endm
  1972.       
  1973.       .macro tdlti
  1974.        tdi 16,\1,\2
  1975.       .endm
  1976.       
  1977.       .macro tdlei
  1978.        tdi 20,\1,\2
  1979.       .endm
  1980.       
  1981.       .macro tdeqi
  1982.        tdi 4,\1,\2
  1983.       .endm
  1984.       
  1985.       .macro tdgei
  1986.        tdi 12,\1,\2
  1987.       .endm
  1988.       
  1989.       .macro tdgti
  1990.        tdi 8,\1,\2
  1991.       .endm
  1992.       
  1993.       .macro tdnli
  1994.        tdi 12,\1,\2
  1995.       .endm
  1996.       
  1997.       .macro tdnei
  1998.        tdi 24,\1,\2
  1999.       .endm
  2000.       
  2001.       .macro tdngi
  2002.        tdi 20,\1,\2
  2003.       .endm
  2004.       
  2005.       .macro tdllti
  2006.        tdi 2,\1,\2
  2007.       .endm
  2008.       
  2009.       .macro tdllei
  2010.        tdi 6,\1,\2
  2011.       .endm
  2012.       
  2013.       .macro tdlgei
  2014.        tdi 5,\1,\2
  2015.       .endm
  2016.       
  2017.       .macro tdlgti
  2018.        tdi 1,\1,\2
  2019.       .endm
  2020.       
  2021.       .macro tdlnli
  2022.        tdi 5,\1,\2
  2023.       .endm
  2024.       
  2025.       .macro tdlngi
  2026.        tdi 6,\1,\2
  2027.       .endm
  2028.       
  2029.       
  2030.       .macro mtxer
  2031.        mtspr 1,\1
  2032.       .endm
  2033.       
  2034.       .macro mtlr
  2035.        mtspr 8,\1
  2036.       .endm
  2037.       
  2038.       .macro mtctr
  2039.        mtspr 9,\1
  2040.       .endm
  2041.       
  2042.       .macro mtdsisr
  2043.        mtspr 18,\1
  2044.       .endm
  2045.       
  2046.       .macro mtdar
  2047.        mtspr 19,\1
  2048.       .endm
  2049.       
  2050.       .macro mtdec
  2051.        mtspr 22,\1
  2052.       .endm
  2053.       
  2054.       .macro mtsdr1
  2055.        mtspr 25,\1
  2056.       .endm
  2057.       
  2058.       .macro mtsrr0
  2059.        mtspr 26,\1
  2060.       .endm
  2061.       
  2062.       .macro mtsrr1
  2063.        mtspr 27,\1
  2064.       .endm
  2065.       
  2066.       .macro mtsprg
  2067.        mtspr 272+(\1),\2
  2068.       .endm
  2069.       
  2070.       .macro mtasr
  2071.        mtspr 280,\1
  2072.       .endm
  2073.       
  2074.       .macro mtear
  2075.        mtspr 282,\1
  2076.       .endm
  2077.       
  2078.       .macro mttbl
  2079.        mtspr 284,\1
  2080.       .endm
  2081.       
  2082.       .macro mttbu
  2083.        mtspr 285,\1
  2084.       .endm
  2085.       
  2086.       .macro mtibatu
  2087.        mtspr 528+2*(\1),\2
  2088.       .endm
  2089.       
  2090.       .macro mtibatl
  2091.        mtspr 529+2*(\1),\2
  2092.       .endm
  2093.       
  2094.       .macro mtdbatu
  2095.        mtspr 536+2*(\1),\2
  2096.       .endm
  2097.       
  2098.       .macro mtdbatl
  2099.        mtspr 537+2*(\1),\2
  2100.       .endm
  2101.       
  2102.       .macro mtdabr
  2103.        mtspr 1013,\1
  2104.       .endm
  2105.       
  2106.       .macro mfxer
  2107.        mfspr \1,1
  2108.       .endm
  2109.       
  2110.       .macro mflr
  2111.        mfspr \1,8
  2112.       .endm
  2113.       
  2114.       .macro mfctr
  2115.        mfspr \1,9
  2116.       .endm
  2117.       
  2118.       .macro mfdsisr
  2119.        mfspr \1,18
  2120.       .endm
  2121.       
  2122.       .macro mfdar
  2123.        mfspr \1,19
  2124.       .endm
  2125.       
  2126.       .macro mfdec
  2127.        mfspr 22,\1
  2128.       .endm
  2129.       
  2130.       .macro mfsdr1
  2131.        mfspr \1,25
  2132.       .endm
  2133.       
  2134.       .macro mfsrr0
  2135.        mfspr \1,26
  2136.       .endm
  2137.       
  2138.       .macro mfsrr1
  2139.        mfspr \1,27
  2140.       .endm
  2141.       
  2142.       .macro mfsprg
  2143.        mfspr \1,272+(\2)
  2144.       .endm
  2145.       
  2146.       .macro mfasr
  2147.        mfspr \1,280
  2148.       .endm
  2149.       
  2150.       .macro mfear
  2151.        mfspr \1,282
  2152.       .endm
  2153.       
  2154.       .macro mftbl
  2155.        mftb \1,268
  2156.       .endm
  2157.       
  2158.       .macro mftbu
  2159.        mftb \1,269
  2160.       .endm
  2161.       
  2162.       .macro mfpvr
  2163.        mfspr \1,287
  2164.       .endm
  2165.       
  2166.       .macro mfibatu
  2167.        mfspr \1,528+2*(\2)
  2168.       .endm
  2169.       
  2170.       .macro mfibatl
  2171.        mfspr \1,529+2*(\2)
  2172.       .endm
  2173.       
  2174.       .macro mfdbatu
  2175.        mfspr \1,536+2*(\2)
  2176.       .endm
  2177.       
  2178.       .macro mfdbatl
  2179.        mfspr \1,537+2*(\2)
  2180.       .endm
  2181.       
  2182.       .macro mfdabr
  2183.        mfspr \1,1013
  2184.       .endm
  2185.       
  2186.       
  2187.       .macro nop
  2188.        ori 0,0,0
  2189.       .endm
  2190.       
  2191.       .macro li
  2192.        addi \1,0,\2
  2193.       .endm
  2194.       
  2195.       .macro lis
  2196.        addis \1,0,\2
  2197.       .endm
  2198.       
  2199.       .macro mr
  2200.        or \1,\2,\2
  2201.       .endm
  2202.       
  2203.       .macro mr.
  2204.        or. \1,\2,\2
  2205.       .endm
  2206.       
  2207.       .macro not
  2208.        nor \1,\2,\2
  2209.       .endm
  2210.       
  2211.       .macro not.
  2212.        nor. \1,\2,\2
  2213.       .endm
  2214.       
  2215.       .macro mtcr
  2216.        mtcrf 0xff,\1
  2217.       .endm
  2218.  
  2219.  
  2220. BUGS
  2221.      Not all of the 64-bit extended mnemonics are supported.
  2222.  
  2223.  
  2224. Frank Wille                  26-Jan-2001                frank@phoenix.owl.de
  2225.